package cn.carrental.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.carrental.pojo.Users;
import cn.carrental.service.UsersService;
@Controller
@RequestMapping("/user")
public class UsersController {
	@Resource
	private UsersService usersService;

	public void setUsersService(UsersService usersService) {
		this.usersService = usersService;
	}
	@RequestMapping("/login")
	public String UsersLogin(@RequestParam("Name")String USERNAME,@RequestParam("Password")String USERPWD,Model model){
		Users users= usersService.Userslogin(USERNAME, USERPWD);
		if(users!=null){
			//model.addAttribute("users",users);
			return "index";
		}
		return "login";
	}
	
	
}
